grammar demo;

file: section+;
// section
section: section_header;

// [gd_scene load_steps=10 format=2] [node name="main" type="Node"]
section_header: LETT ID attribute+ RIGHT;
attribute: ID '=' value;

INT: DIGIT+;
DIGIT: [0-9];

// instance(p1,p2);
instance: ID agrs;
agrs: '(' value (',' value)* ')';
value: instance | INT |  STRING_ | 'true' | 'false' | 'null';

// ID
ID: CHAR NameChar*;

NameChar: CHAR | '_' | DIGIT;
fragment CHAR: ('a' ..'z' | 'A' ..'Z');

STRING_: '"' ~["]* '"';

// Bool
BOOL_: 'true' | 'flase';

LETT: '[';
RIGHT: ']';

WS: (' ' | '\r' | '\n' | '\t') -> skip;